package lab02.test08;


public class  Usb{
    public static void main(String[] args) {
//主函数里面调用类等的方法要实例化new
    UsbDiskWriter usbDiskWriter=new UsbDiskWriter();
    Camera camera=new Camera();
    Mobile mobile=new Mobile();
        usbDiskWriter.start();
        usbDiskWriter.stop();
        camera.start();//new一下后调用下面相应类
        camera.stop() ;
        mobile.start();
        mobile.stop();

    }
}

 interface Usb1 {//USB接口接入
    public abstract void  start();//start方法
     public abstract void stop();//方法

}
class UsbDiskWriter implements Usb1{//implements

    @Override
    public void start() {
        System.out.println("U盘类开始");
    }
    @Override//重写ctrl+o快捷键
    public void stop(){
        System.out.println("U盘类结束");
    }

    }
class Camera implements  Usb1{
    @Override
    public void start(){
        System.out.println("相机类开始");
    }
    @Override
    public void stop(){
        System.out.println("相机类结束");
    }
}
class Mobile implements Usb1{
    @Override
    public void start(){
        System.out.println("手机类开始");
    }
    @Override
    public void stop(){
        System.out.println("手机类结束");
    }
}

